// eslint-disable-next-line vue/multi-word-component-names
<template>
  <div class="nav">
    <main>
      <router-view></router-view>
    </main>
    <footer>
      <van-tabbar v-model="active">
        <van-tabbar-item :icon="item.icon" v-for="(item,index) in tabbar" :key="index" >
          <router-link :to="item.path"> {{ item.meta?.title}} </router-link>
        </van-tabbar-item>
      </van-tabbar>
    </footer>
  </div>
</template>

<script lang="ts" setup>
import { ref, defineProps } from 'vue';
const tabbar = ref([]);
const props = defineProps({
  router: {
    type: Array,
    default: ''
  }
});
tabbar.value = props.router;
const active = ref(0);
</script>
<style lang="scss" scoped>
.nav {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  main {
    width: 100%;
    height: 92vh;
    overflow: auto;
  }
  footer {
    width: 100vw;
    height: 8vh;
  }
}
</style>
